package com.tangyuan.user.controller;

import com.tangyuan.common.result.Result;
import com.tangyuan.user.domain.dto.AddAgentReviewDTO;
import com.tangyuan.user.service.IAgentReviewService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 代理审核表 前端控制器
 * </p>
 *
 * @author Shuai
 * @since 2024-08-21
 */
@RestController
@RequestMapping("/user/agent")
@RequiredArgsConstructor
public class AgentReviewController {
    private final IAgentReviewService agentReviewService;

    @PostMapping("/addReview")
    public Result<Object> getAgentReview(
            @RequestHeader(name = "userId", required = false) Long userId,
            @Valid @RequestBody AddAgentReviewDTO addAgentReviewDTO
    ) {
        agentReviewService.addAgentReview(userId, addAgentReviewDTO);
        return Result.ok();
    }
}
